}
}
-@function _widget_edge($c:$borders_edge) {
-// outer highlight "used" on most widgets
- @if $c == none { @return none; }
- @else { @return 0 1px $c; }
-}
-
@mixin _shadows($list...) {
//
// Helper mixin to stack up to box-shadows;
// entries
-@mixin entry($t, $fc:$focus_border_color, $edge: none) {
+@mixin entry($t, $fc:$focus_border_color) {
//
// Entries drawing function
//
// $t: entry type
// $fc: focus color
-// $edge: set to none to not draw the bottom edge or specify a color to not
-// use the default one
//
// possible $t values:
// normal, focus, insensitive, backdrop, backdrop-insensitive, osd, osd-focus, osd-backdrop, block_cursor;
//
- $_blank_edge: if($edge == none, none, 0 1px transparentize($edge, 1));
- $_entry_edge: if($edge == none, none, _widget_edge($edge));
-
@if $t==normal {
color: $text_color;
border-color: $borders_color;
color: $insensitive_fg_color;
border-color: $borders_color;
background-color: $insensitive_bg_color;
- box-shadow: $_entry_edge;
}
@if $t==backdrop {
color: $backdrop_text_color;
border-color: $backdrop_borders_color;
background-color: $backdrop_base_color;
- box-shadow: $_blank_edge;
}
@if $t==backdrop-insensitive {
color: $backdrop_insensitive_color;
border-color: $backdrop_borders_color;
background-color: $insensitive_bg_color;
- box-shadow: $_blank_edge;
}
@if $t==osd {
color: $osd_text_color;
background-color: transparentize(opacify($osd_borders_color, 1), 0.5);
background-clip: padding-box;
box-shadow: none;
- text-shadow: 0 1px black;
-gtk-icon-shadow: 0 1px black;
}
@if $t==osd-focus {
border-color: $selected_bg_color;
background-color: transparentize(opacify($osd_borders_color, 1), 0.5);
background-clip: padding-box;
- text-shadow: 0 1px black;
- -gtk-icon-shadow: 0 1px black;
}
@if $t==osd-insensitive {
color: $osd_insensitive_fg_color;
border-color: $osd_borders_color;
background-color: $osd_insensitive_bg_color;
background-clip: padding-box;
- box-shadow: none;
- text-shadow: none;
- -gtk-icon-shadow: none;
}
@if $t==osd-backdrop {
color: $osd_text_color;
border-color: $osd_borders_color;
background-color: transparentize(opacify($osd_borders_color, 1), 0.5);
background-clip: padding-box;
- box-shadow: none;
- text-shadow: none;
- -gtk-icon-shadow: none;
}
@if $t==block_cursor {
color: $base_color;
}
-@function _button_hilight_color($c) {
-//
-// calculate the right top highlight color for buttons
-//
-// $c: base color;
-//
- @if lightness($c)>95% { @return white; }
- @else if lightness($c)>90% { @return transparentize(white, 0.2); }
- @else if lightness($c)>80% { @return transparentize(white, 0.5); }
- @else if lightness($c)>50% { @return transparentize(white, 0.8); }
- @else if lightness($c)>40% { @return transparentize(white, 0.9); }
- @else { @return transparentize(white, 0.98); }
-}
-
-
-
-@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: none) {
+@mixin button($t, $c:$bg_color, $tc:$fg_color) {
//
// Button drawing function
//
// $t: button type,
// $c: base button color for colored* types
// $tc: optional text color for colored* types
-// $edge: set to none to not draw the bottom edge or specify a color to not
-// use the default one
//
// possible $t values:
// normal, hover, active, insensitive, insensitive-active,
// backdrop, backdrop-active, backdrop-insensitive, backdrop-insensitive-active,
// osd, osd-hover, osd-active, osd-insensitive, osd-backdrop, undecorated
//
- $_hilight_color: _button_hilight_color($c);
- $_button_edge: if($edge == none, none, _widget_edge($edge));
- $_blank_edge: if($edge == none, none, _widget_edge(transparentize($edge,1)));
$_button_shadow: 0 1px 2px transparentize($shadow_color, 0.03);
@if $t==normal {
border-bottom-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
background-image: if($variant == 'light', linear-gradient(to top, darken($c, 4%) 2px, $c),
linear-gradient(to top, darken($c,1%) 2px, $c));
- @include _shadows(inset 0 1px $_hilight_color, $_button_edge, $_button_shadow);
+ @include _shadows($_button_shadow);
}
@else if $t==hover {
border-bottom-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color);
@if $variant == 'light' {
background-image: linear-gradient(to top, darken($c,16%), darken($c,8%) 1px);
- @include _shadows(inset 0 1px darken($c,1%), $_button_edge, $_button_shadow);
+ @include _shadows($_button_shadow);
}
@else {
background-image: linear-gradient(to top, darken($c,4%) 20%, darken($c, 3%) 90%);
- @include _shadows(inset 0 1px $c, $_button_edge, $_button_shadow);
+ @include _shadows($_button_shadow);
}
}
border-color: if($c != $bg_color, _border_color($c, true), $alt_borders_color); //colored buttons
@if $variant == 'light' {
background-image: linear-gradient(to bottom, lighten($c, 5%) 20%, $c 90%);
- @include _shadows(inset 0 1px _button_hilight_color(lighten($c, 6%)),
- $_button_edge, $_button_shadow);
+ @include _shadows($_button_shadow);
}
@else {
background-image: linear-gradient(to bottom, darken($c, 3%) 20%, darken($c, 6%) 90%);
- @include _shadows(inset 0 1px $_hilight_color,
- $_button_edge, $_button_shadow);
+ @include _shadows($_button_shadow);
}
}
color: $tc;
border-color: if($c != $bg_color, _border_color($c), $borders_color);
background-image: if($variant == 'light', image(darken($c, 14%)), image(darken($c, 9%)));
- @include _shadows(inset 0 1px transparentize($_hilight_color, 1), $_button_edge);
-
- text-shadow: none;
- -gtk-icon-shadow: none;
+ box-shadow: none;
}
@else if $t==insensitive {
color: if($tc != $fg_color, mix($tc, $_bg, 50%), $insensitive_fg_color);
border-color: if($c != $bg_color, _border_color($c), $insensitive_borders_color);
background-image: image($_bg);
- text-shadow: none;
- -gtk-icon-shadow: none;
- // white with 0 alpha to avoid an ugly transition, since no color means
- // black with 0 alpha
- @include _shadows(inset 0 1px transparentize(white, 1), $_button_edge);
}
@else if $t==insensitive-active {
color: if($c != $bg_color, mix($tc, $_bg, 60%), $insensitive_fg_color);
border-color: $_bc;
background-image: image($_bg);
- // white with 0 alpha to avoid an ugly transition, since no color means
- // black with 0 alpha
- @include _shadows(inset 0 1px transparentize(white, 1), $_button_edge);
+ box-shadow: none;
}
@else if $t==backdrop {
color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
background-image: image($_bg);
- text-shadow: none;
- -gtk-icon-shadow: none;
- @include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
+ box-shadow: none;
}
@else if $t==backdrop-active {
color: if($tc != $fg_color, mix($tc, $_bg, 80%), $backdrop_fg_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
background-image: image($_bg);
- @include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
+ box-shadow: none;
}
@else if $t==backdrop-insensitive {
color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
background-image: image($_bg);
- text-shadow: none;
- -gtk-icon-shadow: none;
- // white with 0 alpha to avoid an ugly transition, since no color means
- // black with 0 alpha
- @include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
+ box-shadow: none;
}
@else if $t==backdrop-insensitive-active {
color: if($c != $bg_color, mix($tc, $_bg, 35%), $backdrop_insensitive_color);
border-color: if($c != $bg_color, $_bc, $backdrop_borders_color);
background-image: image($_bg);
- @include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
+ box-shadow: none;
}
@else if $t==osd {
background-color: transparent;
background-image: image($_bg);
background-clip: padding-box;
- box-shadow: inset 0 1px transparentize(white, 0.9);
- text-shadow: none;
- -gtk-icon-shadow: none;
}
@else if $t==osd-hover {
background-color: transparent;
background-image: image($_bg);
background-clip: padding-box;
- box-shadow: inset 0 1px transparentize(white, 0.9);
- text-shadow: none;
- -gtk-icon-shadow: none;
}
@else if $t==osd-active {
background-image: image($_bg);
background-clip: padding-box;
box-shadow: none;
- text-shadow: none;
- -gtk-icon-shadow: none;
}
@else if $t==osd-insensitive {
background-color: transparent;
background-image: image($osd_insensitive_bg_color);
background-clip: padding-box;
- box-shadow: none;
- text-shadow: none;
- -gtk-icon-shadow: none;
}
@else if $t==osd-backdrop {
background-color: transparent;
background-image: image($_bg);
background-clip: padding-box;
- box-shadow: none;
- text-shadow: none;
- -gtk-icon-shadow: none;
}
@else if $t==undecorated {
border-color: transparent;
background-color: transparent;
background-image: none;
-
- @include _shadows(inset 0 1px transparentize(white, 1), $_blank_edge);
-
- text-shadow: none;
- -gtk-icon-shadow: none;
+ box-shadow: none;
}
@else if $t==undecorated-hover {
border-color: transparent;
background-image: none;
box-shadow: none;
- text-shadow: none;
@if $variant == 'light' {
background-color: darken($c,14%);
} @else {
border-color: transparent;
background-image: none;
box-shadow: none;
- text-shadow: none;
@if $variant == 'light' {
background-color: darken($c,30%);
}
}
}
-@mixin headerbar_fill($c:$headerbar_bg_color, $hc:$top_hilight, $ov: none) {
+@mixin headerbar_fill($c:$headerbar_bg_color, $ov: none) {
//
// headerbar fill
//
// $c: base color
-// $hc: top highlight color
// $ov: a background layer for background shorthand (hence no commas!)
//
$gradient: linear-gradient(to top, darken($c, 2%), lighten($c, 1%));
@if $ov != none { background: $c $ov, $gradient; }
@else { background: $c $gradient; }
- box-shadow: inset 0 1px $hc; // top highlight
}
@mixin overshoot($p, $t:normal, $c:$fg_color) {